package com.example.myapplicationndk.viewmodel;

import android.os.Bundle;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

public class MainModel extends ViewModel {

    public static MainModel newInstance(Integer i) {
        Bundle args = new Bundle();
        MainModel model = new MainModel(i);
        return model;
    }

    private MutableLiveData<Integer> mCurrentName = new MutableLiveData<>();

    public MainModel(Integer t) {
        super();
        mCurrentName.postValue(t);

    }

    // Create a LiveData with a String


    public MutableLiveData<Integer> getCurrentName() {
        return mCurrentName;
    }

    public void addOne() {

        Integer value = mCurrentName.getValue();
        value++;
        mCurrentName.setValue(value);
    }

}